package com.anzhen.interview.singleton;

/**
 * 懒汉--静态内部类方式
 * Created by zhenan on 2017-3-20.
 */
public class Singleton_Lazy_Static_InnerClass {
    // 利用静态内部类特性实现外部类的单例
    private static class SingleTonBuilder {
        private static Singleton_Lazy_Static_InnerClass singleTon = new Singleton_Lazy_Static_InnerClass();
    }

    // 私有化构造函数
    private Singleton_Lazy_Static_InnerClass() {

    }

    public static Singleton_Lazy_Static_InnerClass getInstance() {
        return SingleTonBuilder.singleTon;
    }
}
